import request from '@/utils/request'

const movieUrl = '/v2/movie'
const detailUrl = '/v2/detail'
const orderUrl = '/v2/order'
const commentUrl = '/v2/comment'

export const movieList = (data) =>
    request.get(movieUrl, { params: data })

export const movieDetail = (id) =>
    request.get(detailUrl + '?id=' + id)
export const movieComment = (data) =>
    request.post(detailUrl + '/comment', data)
export const seatList = (id) =>
    request.get(detailUrl + '/seats?id=' + id)

export const orderCreate = (data) =>
    request.post(orderUrl, data)
export const orderGet = (id) =>
    request.get(orderUrl + "?user_id=" + id)
export const orderPay = (data) =>
    request.put(orderUrl, data)
export const orderCancel = (id) =>
    request.delete(orderUrl + '?id=' + id)

export const commentList = (id) =>
    request.get(commentUrl + '?movie_id=' + id)

export const commentCreate = (data) =>
    request.post(commentUrl, data)